package getFromDBMethods;

import java.util.ArrayList;

import org.json.JSONException;

import ServletProcess.AllBuddies;
import Storage.Buddy;

public class getAllBuddies {
	public static ArrayList<Buddy> process(String currentPhoneNumber)
			throws JSONException {
		ArrayList<Buddy> buddylist = new ArrayList<Buddy>();
		String buddylistJson = AllBuddies.process(currentPhoneNumber);
		// Reverse ArrayList.toString
		if (!buddylistJson.equals("[]")) {
			buddylist = JsonProcess.jAllBuddies.process(buddylistJson);
		}
		return buddylist;
	}
}
